PROTO_SRC_PATH=./rpc/webapi
protoc \
  --proto_path=$PROTO_SRC_PATH \
  --twirp_out=$PROTO_SRC_PATH \
  --go_out=$PROTO_SRC_PATH \
  --go-grpc_out=$PROTO_SRC_PATH \
  service.proto


# protoc 
# PB_DIR=./rpc
# PB_MODULE_DIRS=(shared mwebapi webapi)
# # PROTO_SRC_PATH=$PB_DIR/webapi

# for MOD_NAME in ${PB_MODULE_DIRS[@]};
# do
#     MOD_PATH=$PB_DIR/$MOD_NAME
#     MOD_OUTPUT_PATH=$MOD_PATH
#     # echo $MOD_PATH
#     # echo $MOD_OUTPUT_PATH
#     for FILE in `ls $MOD_PATH | grep ".proto$"`
#     do
#       if [ ! -f "$FILE" ]; then
        
#         # FILE_PATH=$MOD_PATH/$FILE
#         # FILE_NAME=$(echo $FILE | sed 's/\.[^.]*$//')
#         # FILE_OUTPUT_PATH=$MOD_OUTPUT_PATH/$FILE_NAME
#         # echo $FILE_PATH
#         # echo $FILE_OUTPUT_PATH
#         # mkdir -p $FILE_OUTPUT_PATH
#         protoc \
#         --proto_path=$PB_DIR \
#         --proto_path=$MOD_PATH \
#         --twirp_out=$MOD_OUTPUT_PATH \
#         --go_out=$MOD_OUTPUT_PATH PROTOC_GO_OPT=paths=source_relative \
#         --go-grpc_out=$MOD_OUTPUT_PATH \
#         $FILE
#       fi
#     done;
# done;